package com.hello.system.service.impl;

import java.util.List;
import com.hello.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hello.system.mapper.FriendRequestsMapper;
import com.hello.system.domain.FriendRequests;
import com.hello.system.service.IFriendRequestsService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 好友申请请求Service业务层处理
 * 
 * @author hello
 * @date 2025-10-29
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class FriendRequestsServiceImpl extends ServiceImpl<FriendRequestsMapper, FriendRequests> implements IFriendRequestsService 
{
    private final FriendRequestsMapper friendRequestsMapper;

    /**
     * 查询好友申请请求
     * 
     * @param requestId 好友申请请求主键
     * @return 好友申请请求
     */
    @Override
    public FriendRequests selectFriendRequestsByRequestId(Long requestId)
    {
        return friendRequestsMapper.selectFriendRequestsByRequestId(requestId);
    }

    /**
     * 查询好友申请请求列表
     * 
     * @param friendRequests 好友申请请求
     * @return 好友申请请求
     */
    @Override
    public List<FriendRequests> selectFriendRequestsList(FriendRequests friendRequests)
    {
        return friendRequestsMapper.selectFriendRequestsList(friendRequests);
    }

    /**
     * 新增好友申请请求
     * 
     * @param friendRequests 好友申请请求
     * @return 结果
     */
    @Override
    public int insertFriendRequests(FriendRequests friendRequests)
    {
        friendRequests.setCreateTime(DateUtils.getNowDate());
        return friendRequestsMapper.insertFriendRequests(friendRequests);
    }

    /**
     * 修改好友申请请求
     * 
     * @param friendRequests 好友申请请求
     * @return 结果
     */
    @Override
    public int updateFriendRequests(FriendRequests friendRequests)
    {
        friendRequests.setUpdateTime(DateUtils.getNowDate());
        return friendRequestsMapper.updateFriendRequests(friendRequests);
    }


    /**
     * 批量删除好友申请请求
     * 
     * @param requestIds 需要删除的好友申请请求主键
     * @return 结果
     */
    @Override
    public int deleteFriendRequestsByRequestIds(Long[] requestIds)
    {
        return friendRequestsMapper.deleteFriendRequestsByRequestIds(requestIds);
    }

    /**
     * 删除好友申请请求信息
     * 
     * @param requestId 好友申请请求主键
     * @return 结果
     */
    @Override
    public int deleteFriendRequestsByRequestId(Long requestId)
    {
        return friendRequestsMapper.deleteFriendRequestsByRequestId(requestId);
    }
}
